package com.hk.admin.common.exception;


import com.hk.admin.common.base.dto.message.Message;
import com.hk.admin.common.util.MessageUtil;
import lombok.Data;
import org.springframework.http.ResponseEntity;

/**
 * <br>
 * <b>功能：</b>全局异常处理<br>
 * <b>作者：</b>Pan.ShiJu<br>
 * <b>日期：</b>2017/4/11 23:27<br>
 */
@Data
public class HKAdminException extends RuntimeException {

    private ResponseEntity<Message> responseEntity;

    public HKAdminException() {
    }

    public HKAdminException(String msg) {
        this.responseEntity = MessageUtil.errorInternalServer(msg);
    }

    public HKAdminException(Integer code, String msg) {
        this.responseEntity = MessageUtil.errorInternalServer(code, msg);
    }


}
